package cn.zebra.dev.member.module.member.entity;

import cn.zebra.dev.base.module.member.entity.BaseMember;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 会员用户表(基础)
 *
 * @author runnable
 * @date 2019-08-29 17:48:12
 */
@TableName("member")
@Getter
@Setter
public class MemberEntity implements Serializable, BaseMember {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty("用户id")
    @TableId(type = IdType.AUTO)
    private Long id;

    @ApiModelProperty("用户唯一码")
    private String memberCode;

    @ApiModelProperty("用户类型")
    private Integer memberType;

    @ApiModelProperty("用户名")
    private String memberName;

    @ApiModelProperty("用户账号")
    private String memberAccount;

    @ApiModelProperty("用户头像")
    private String memberHeadImg;

    @ApiModelProperty("生日 - 年")
    private Integer birthdayYear;

    @ApiModelProperty("生日 - 月")
    private Integer birthdayMonth;

    @ApiModelProperty("生日 - 日")
    private Integer birthdayDay;

    @ApiModelProperty("0->未知;1->男;2->女")
    private Integer sex;

    @ApiModelProperty("年龄")
    private Integer age;

    @ApiModelProperty("上级用户id")
    private Long parentId;

    @ApiModelProperty("用户关系路径")
    private String memberPath;

    @ApiModelProperty("盐")
    private String salt;

    @ApiModelProperty("密码")
    @NotBlank(message = "请输入密码!")
    private String password;

    @ApiModelProperty("二级密码(盐)")
    private String secondarySalt;

    @ApiModelProperty("二级密码")
    private String secondaryPassword;

    @ApiModelProperty("手机号")
    private String phone;

    @ApiModelProperty("邮箱")
    private String email;

    @ApiModelProperty("用户等级")
    private Long memberLevel;

    @ApiModelProperty("0正常|-1冻结(禁用)")
    private Integer status;

    @ApiModelProperty(value = "注册时间", hidden = true)
    private LocalDateTime createTime;

    @ApiModelProperty("经验值")
    private Long levelExp;

    @TableField(exist = false)
    @ApiModelProperty("上级用户账号")
    private String parentMemberAccount;

    @TableField(exist = false)
    @ApiModelProperty("上级用户名")
    private String parentMemberName;

    @TableField(exist = false)
    @ApiModelProperty("用户等级")
    private String levelName;

    @TableField(exist = false)
    @ApiModelProperty("总数")
    private Integer count;
}
